<?php 
   require_once('config.php');
   $action = getValue('action','str','POST','');
   
   if($action == 'submit'){
      $album_name = getValue('album_name','str','POST');
      $cat_id = getValue('cat_id','int','POST');
      $link_profile = getValue('link_profile','str','POST');
      $row_inserted = xinh_albums::add($album_name,$cat_id,$link_profile);
      if($row_inserted > 0){
         echo "Thêm mới thành công";
      }
   }
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Lấy ảnh từ facebook</title>
   <?=$css_global?>
   <?=$js_global?>
</head>
<div class="row-fluid">
   <div class="head">
      <div class="isw-grid"></div>
      <h1>Thêm mới albums</h1>      
      <div class="reload_tab" title="Reload"></div>                         
      <div class="clear"></div>
   </div>
   <div class="block-fluid">
      <form class="form-horizontal" name="add" action="" method="POST" enctype="multipart/form-data"  onsubmit="">
         <input type="hidden" name="action" value="submit" />
         <fieldset>
            <div class="control-group">
               <label class="control-label" for="input01">Tên albums</label>
               <div class="controls">
                  <input type="text" name="album_name" class="span5" id="album_name" placeholder="Nhập tên albums" />
               </div>
            </div>
            <div class="control-group">
               <label class="control-label" for="input01">Thể loại</label>
               <div class="controls">
                  <select id="cat_id" name="cat_id">
                     <?foreach($array_cate as $key=>$value){?>
                        <option value="<?=$key?>"><?=$value?></option>
                     <?}?>
                  </select>
               </div>
            </div>
            <div class="control-group">
               <label class="control-label" for="input01">Link profile</label>
               <div class="controls">
                  <input type="text" name="link_profile" class="span6" id="link_profile" placeholder="Link profile facebook" />
               </div>
            </div>
            <div class="form-actions">
					<button type="submit" class="btn btn-info">Lấy ảnh</button>
					<button type="reset"  class="btn btn-warning">Làm lại</button>
				</div>
         </fieldset>
      </form>
   </div> 
</div>
</html>